package com.test.crawler.utils;

import java.lang.reflect.Field;
import java.util.HashMap;
import java.util.Map;

public class AbstractCrawlerEntry {

    public Map<String, ExtractBy> extractBy() {
        Map<String,ExtractBy> result = new HashMap<>();
        for (Field field : this.getClass().getDeclaredFields()) {
            ExtractBy extract = field.getAnnotation(ExtractBy.class);
            if (extract != null) result.put(field.getName(),extract);
        }
        return result;
    }
}
